package com.xiaohu.myspace.action;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.opensymphony.xwork2.ActionSupport;
import com.xiaohu.myspace.utils.Constants;
import com.xiaohu.myspace.vo.ReturnDataVO;

public class BaseAction extends ActionSupport {
	private static final long serialVersionUID = 8169132436889126813L;

	public static final String SPACE="";
	public static final String FALECODE="1001";
	public static final String SUCCESSCODE="1000";
	
	public static final String returnData="returnData";
	public static final String returnPage="returnPage";
	

	protected String initReturnData(String returnCode,Object object){
		Gson gson=new GsonBuilder().setDateFormat(Constants.TIMEYYYYMMDDHHMMSS).create();
		ReturnDataVO returnData=new ReturnDataVO();
		returnData.setCode(returnCode);
		returnData.setData(object);
		return gson.toJson(returnData);
	}
	

}
